###############################################################################
#
# Copyright (c) 2011 Rainmaker Entertainment
# All Rights Reserved.
#
# This file contains unpublished confidential and proprietary
# information of Rainmaker Entertainment.  The contents of this file
# may not be copied or duplicated, in whole or in part, by any
# means, electronic or hardcopy, without the express prior
# written permission of Rainmaker Entertainment.
#
#    $HeadURL: http://pt/src/trunk/maya/outsource/rnkOutsourceChecker/operations/__init__.py $
#    $Revision: 67708 $
#    $Author: wmakari $
#    $Date: 2013-09-10 16:35:55 -0700 (Tue, 10 Sep 2013) $
#
###############################################################################

###############################################################################
## INFOS
###############################################################################

# List of checks to run for every types


###############################################################################
## MODULES
###############################################################################

import traceback

## Checks modules
import geo
reload(geo)
import rig
reload(rig)
import common
reload(common)
import shader
reload(shader)

# Functions from OF
import ofFix
reload(ofFix)

# OF specific checks
import ofRig
reload(ofRig)

import ofFx
reload(ofFx)

###############################################################################
## FUNCTIONS
###############################################################################   


operationsList = {
              
            ('higeo') : [

                            ## Common
                            common.checkForNonUniqueNames,
                            common.checkUnit,
#                            common.checkAssetRootIsIdNode,
                            common.checkIdNodeScale,
                            common.checkIdNodeTranslation,
                            common.checkIdNodeRotation,
                            common.checkNamespace,    
                            
                            ## Geometry
                            geo.checkEmptyShapes,     
                            geo.checkUV,    
                            shader.checkSidedness,    
                            shader.checkOpposite,    
                            geo.checkGeoVisibility,    

                            geo.suffixCheck,    
                            geo.checkNamesEndWithNumber,    

                            geo.checkHistory,    
                            geo.checkPivot,    
                            geo.isMeshTweaked,    

                            geo.checkQuadPolygons,    
                            geo.checkFacesWithHoles,    
                            geo.checkZeroLengthEdges,    
                            geo.checkNonmanifoldGeo,  
                            geo.useOldStyleSubdivs,    
                            geo.checkTrianglesSharingVtx,                          

                            ofFix.deleteHistory,
                            ofFix.checkInstanceModel,
                            ofFix.checkInvalidModel,
                            ofFix.checkSameObjectInSameSpace,
                            ofFix.checkInvalidObjTransform,
                            ],

            ('hirig') : [
                           ## Common
                            common.checkForNonUniqueNames,
                            common.checkIdNodeScale,
                            common.checkIdNodeTranslation,
                            common.checkIdNodeRotation,
                            
                            ## Rig
                            geo.suffixCheck,
                            rig.checkInfoCtrl, 
                            rig.checkControllerAttributesWithInput, 
                            rig.checkControllerLockedAttributes, 
                            rig.checkNonAnimatableAttr, 
                            rig.checkNonNormalizedWeights, 
                            rig.checkNanErrors, 
                            shader.checkOpposite, 
                            shader.checkSidedness, 

                            ofRig.doesHookNodeExist,
                            ofRig.doesItHaveParents,
                            ofRig.placeHolderNodesShouldBeIncludedToSet,
                            ofRig.areParentsMasterNodesLocked,

                            ofRig.controllerSuffix,
                            #ofRig.geoSuffix,
                            ofRig.doesVisibility_ctrlExist,
                            ofRig.doRootControllersExist,
                            ofRig.areRootControllersLocked,
                            ofRig.checkColorIndex,
                            ofRig.listDisplayLayers,

#                            ofFix.renameCtrl,
                            
                            ],

            ('midrig') : [
                           ## Common
                            common.checkForNonUniqueNames,
                            common.checkIdNodeScale,
                            common.checkIdNodeTranslation,
                            common.checkIdNodeRotation,
                            
                            ## Rig
                            rig.checkInfoCtrl, 
                            rig.checkControllerAttributesWithInput, 
                            rig.checkControllerLockedAttributes, 
                            rig.checkNonAnimatableAttr, 
                            rig.checkNonNormalizedWeights, 
                            rig.checkNanErrors, 

                            ofRig.doesHookNodeExist,
                            ofRig.doesItHaveParents,
                            ofRig.placeHolderNodesShouldBeIncludedToSet,
                            ofRig.areParentsMasterNodesLocked,

                            ofRig.controllerSuffix,
                            ofRig.doesVisibility_ctrlExist,
                            ofRig.doRootControllersExist,
                            ofRig.areRootControllersLocked,
                            ofRig.checkColorIndex,
                            ofRig.listDisplayLayers,

                            rig.geoExists,
                            ],

            ('lorig') : [
                           ## Common
                            common.checkForNonUniqueNames,
                            
                            ## Rig
                            rig.checkInfoCtrl, 
                            rig.checkControllerAttributesWithInput, 
                            rig.checkControllerLockedAttributes, 
                            rig.checkNonAnimatableAttr,
                            rig.geoExists,
#                            ofFix.renameCtrl, 
                            ],
                  
            ('hifx') : [
                           ## Common
                            common.checkForNonUniqueNames,
                            ofFx.checkExistingCaches,
                            
                            ],
              }
